package com.cykj.eurekaclient.controller;

import com.alibaba.fastjson.JSON;
import com.cykj.eurekaclient.bean.CityInfo;
import com.cykj.eurekaclient.bean.StationInfo;
import com.cykj.eurekaclient.service.StationInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class StationInfoController {

    @Autowired
    StationInfoService stationInfoService;

    /**
     * @version 1.0
     * @author: zhiMing
     * @date: 2021/9/23 1:00
     * @desc: 控制层，接收消费端的请求，查询某地区的所有站点
     */
    @RequestMapping("getStationList")
    public CityInfo getStationList(String district){
        CityInfo cityInfo = stationInfoService.getStationList(district);
//        System.out.println(JSON.toJSONString(cityInfo));
        return cityInfo;
    }
}
